﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;

#nullable disable

namespace ERP.Migrations
{
    /// <inheritdoc />
    public partial class _0625ShiftplanningModel_IncomingInspection : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "IncomingInspection",
                columns: table => new
                {
                    Id = table.Column<int>(type: "integer", nullable: false)
                        .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
                    IncomingInspectionCode = table.Column<string>(type: "text", nullable: false),
                    IncomingInspectionName = table.Column<string>(type: "text", nullable: false),
                    IncomingInspectionJName = table.Column<string>(type: "text", nullable: false),
                    Batch = table.Column<string>(type: "text", nullable: false),
                    ProductCode = table.Column<string>(type: "text", nullable: false),
                    ProductName = table.Column<string>(type: "text", nullable: false),
                    ReceiveNum = table.Column<int>(type: "integer", nullable: true),
                    TestingNum = table.Column<int>(type: "integer", nullable: true),
                    UnqualifiedNum = table.Column<int>(type: "integer", nullable: true),
                    TestingResult = table.Column<string>(type: "text", nullable: false),
                    IncomingDate = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
                    TestingDate = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
                    TestingPerson = table.Column<string>(type: "text", nullable: false),
                    State = table.Column<int>(type: "integer", nullable: true),
                    CreateTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
                    UpdateTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_IncomingInspection", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "ShiftplanningModel",
                columns: table => new
                {
                    Id = table.Column<int>(type: "integer", nullable: false)
                        .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
                    PlanNumber = table.Column<string>(type: "text", nullable: false),
                    PlanName = table.Column<string>(type: "text", nullable: false),
                    StartTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
                    EndTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
                    TeamType = table.Column<string>(type: "text", nullable: false),
                    ShiftWay = table.Column<string>(type: "text", nullable: false),
                    ProductionWay = table.Column<string>(type: "text", nullable: false),
                    DocumentStatus = table.Column<string>(type: "text", nullable: false),
                    Descr = table.Column<string>(type: "text", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_ShiftplanningModel", x => x.Id);
                });
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "IncomingInspection");

            migrationBuilder.DropTable(
                name: "ShiftplanningModel");
        }
    }
}
